package com.tydic.system.controller.system;

import com.tydic.common.core.domain.R;
import com.tydic.common.web.core.BaseController;
import com.tydic.system.domain.vo.SysDictTypeVo;
import com.tydic.system.service.ISysDictTypeService;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据字典信息
 *
 * @author Lion Li
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/sys/dictType")
public class SysDictTypeController extends BaseController {

    private final ISysDictTypeService dictTypeService;


    /**
     * 字典类型详情
     *
     * @param id
     * @return
     */
    @GetMapping("/form")
    public R<SysDictTypeVo> form(@NotBlank(message = "字典类型id不能为空") String id) {
        return R.ok(dictTypeService.queryById(id));
    }

}
